<?php
/*
 * @Author: your name
 * @Date: 2020-11-17 15:43:32
 * @LastEditTime: 2020-12-23 15:12:39
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: /special/application/api/validate/FirewallRuleValidate.php
 */
namespace app\api\validate;

use think\Validate;

class FirewallRuleValidate extends Validate
{
    protected $rule = [
        //主机码
        'hostkey' => 'require|alphaNum|length:32',
        //规则下发时间
        'create_time' => 'require|number|length:10,11',
        //错误码
        'error_code' => 'require|number|length:1,5',
        //错误消息
        'error_message' => 'require|chsDash|length:0,255',
        //上传规则类型
        'type' => 'require|alphaDash',
        //日志id
        'logId' => 'integer',
        //规则内容
        'content' => 'require|array',
        //windwos 的防火墙网络主开关
        'states' => 'require|array',
        //windwos 的防火墙默认处理方式
        'default' => 'require|array'
    ];

    protected $scene = [
        'rule_upload' => ['hostkey','create_time','error_code','error_message','type'],
        'rule_download' => ['hostkey','logId'],
        'windows_set_upload' => ['states','default']
    ];
}